package com.shrct.businessprocess.customerservice.impl;

import com.shrct.businessprocess.customerservice.RCFaultReportProduct;
import com.shrct.businessprocess.customerservice.RCFaultReportRMAInfo;
import com.shrct.businessprocess.customerservice.impl.RCFaultReportProductImpl;
import com.shrct.businessprocess.customerservice.proxy.RCFaultReportRMAInfoProxy;
import com.shrct.businessprocess.product.RCRMAEvent;
import com.shrct.businessprocess.product.impl.RCRMAEventImpl;
import edu.fudan.mylang.pf.BaseModelObject;
import java.util.Date;
import javax.persistence.CascadeType;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.DiscriminatorOptions;

@Entity
@DiscriminatorValue("RCFAULTREPORTRMAINFO_TYPE")
@DiscriminatorOptions(force = true)
@DiscriminatorColumn(length = 64)
@Table(name = "rcfaultreportrmainfo")
public abstract class RCFaultReportRMAInfoImpl extends BaseModelObject implements RCFaultReportRMAInfo {
  public RCFaultReportRMAInfoImpl() {
    super();
  }
  
  public RCFaultReportRMAInfoImpl(final RCFaultReportProduct product) {
    super();
    this.product = product;
  }
  
  @JoinColumn(name = "product_id")
  @ManyToOne(targetEntity = RCFaultReportProductImpl.class, cascade = { CascadeType.MERGE, CascadeType.PERSIST })
  private RCFaultReportProduct product;
  
  public RCFaultReportProduct getProduct() {
    return this.product;
  }
  
  public RCFaultReportRMAInfo setProduct(final RCFaultReportProduct product) {
    this.product = product;
    return this;			
    
  }
  
  private Date newItemArriveDate;
  
  public Date getNewItemArriveDate() {
    return this.newItemArriveDate;
  }
  
  public RCFaultReportRMAInfo setNewItemArriveDate(final Date newItemArriveDate) {
    this.newItemArriveDate = newItemArriveDate;
    return this;			
    
  }
  
  private Date newItemInstallDate;
  
  public Date getNewItemInstallDate() {
    return this.newItemInstallDate;
  }
  
  public RCFaultReportRMAInfo setNewItemInstallDate(final Date newItemInstallDate) {
    this.newItemInstallDate = newItemInstallDate;
    return this;			
    
  }
  
  private Date badItemReceiveDate;
  
  public Date getBadItemReceiveDate() {
    return this.badItemReceiveDate;
  }
  
  public RCFaultReportRMAInfo setBadItemReceiveDate(final Date badItemReceiveDate) {
    this.badItemReceiveDate = badItemReceiveDate;
    return this;			
    
  }
  
  private Date badItemReturnDate;
  
  public Date getBadItemReturnDate() {
    return this.badItemReturnDate;
  }
  
  public RCFaultReportRMAInfo setBadItemReturnDate(final Date badItemReturnDate) {
    this.badItemReturnDate = badItemReturnDate;
    return this;			
    
  }
  
  private String supplierName;
  
  public String getSupplierName() {
    return this.supplierName;
  }
  
  public RCFaultReportRMAInfo setSupplierName(final String supplierName) {
    this.supplierName = supplierName;
    return this;			
    
  }
  
  private String rmaNumber;
  
  public String getRmaNumber() {
    return this.rmaNumber;
  }
  
  public RCFaultReportRMAInfo setRmaNumber(final String rmaNumber) {
    this.rmaNumber = rmaNumber;
    return this;			
    
  }
  
  private String caseNumber;
  
  public String getCaseNumber() {
    return this.caseNumber;
  }
  
  public RCFaultReportRMAInfo setCaseNumber(final String caseNumber) {
    this.caseNumber = caseNumber;
    return this;			
    
  }
  
  private String comment;
  
  public String getComment() {
    return this.comment;
  }
  
  public RCFaultReportRMAInfo setComment(final String comment) {
    this.comment = comment;
    return this;			
    
  }
  
  @JoinColumn(name = "rma_id")
  @ManyToOne(targetEntity = RCRMAEventImpl.class, cascade = { CascadeType.MERGE, CascadeType.PERSIST })
  private RCRMAEvent rma;
  
  public RCRMAEvent getRma() {
    return this.rma;
  }
  
  public RCFaultReportRMAInfo setRma(final RCRMAEvent rma) {
    this.rma = rma;
    return this;			
    
  }
  
  private Boolean isFinished;
  
  public Boolean getIsFinished() {
    return this.isFinished;
  }
  
  public RCFaultReportRMAInfo setIsFinished(final Boolean isFinished) {
    this.isFinished = isFinished;
    return this;			
    
  }
  
  public RCFaultReportRMAInfoProxy toProxy() {
    com.shrct.businessprocess.customerservice.proxy.RCFaultReportRMAInfoProxy proxy = new com.shrct.businessprocess.customerservice.proxy.RCFaultReportRMAInfoProxy();
    proxy.setId(this.getId());
    if(this instanceof edu.fudan.mylang.pf.INamedModelObject){
    	proxy.setName(((edu.fudan.mylang.pf.INamedModelObject)this).getEntityName());
    }
    return proxy;
    
  }
}
